package com.tanhua.server.controller;

import com.tanhua.server.interceptor.UserHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/huanxin")
public class HuanXinController {
    @GetMapping("/user")
    public ResponseEntity findHuanXinUser() {
        Map<String ,Object> result  = new HashMap<>();
        result.put("username", UserHolder.getUser().getId().toString());
        result.put("password", "123456");
        log.info("【环信】APP登录帐号: {}", result);
        return ResponseEntity.ok(result);
    }
}
